package vip.jc.integration.dynamicwithshardingSphere.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vip.jc.integration.dynamicwithshardingSphere.dao.entity.User;

@Mapper
public interface UserMapper {

    @Select("SELECT * FROM user where id = #{id}")
    public User selectById(@Param("id") Long id);

    @Insert("INSERT INTO user (id, name) VALUES (#{user.id}, #{user.name})")
    void addUser(@Param("user") User user);

}
